function [ g ] = desired_parity( patterns )
global FALSE;

% DESIRED_parity
% Esta funcion devuelve los valores deseados acorde a la funcion paridad

g = zeros(1, length(patterns));
for i = 1:length(patterns)
   count = 0;
   pattern = patterns(:,i);
   for j = 2:length(pattern)
      if pattern(j) ~= FALSE
          count = count+1;
      end
   end
   if mod(count,2) == 1
      g(i) = 1;
   else
      g(i) = FALSE;
   end
end

end

